package cz.possoft.explorer.utils;

/**
 * Class can be used for various util helper methods.
 * 
 * @author <a href="mailto:mposolda@gmail.com">Marek Posolda</a>
 * @version $Revision$
 */
public class Utils
{
   /**
    * Find class from name where name can be primitive type or normal java class.
    * 
    * @param className
    * @return Class<?>
    * @throws ClassNotFoundException
    */
   public static Class<?> findClassFromName(String className) throws ClassNotFoundException
   {      
      if (className.equals("long"))
      {
         return long.class;
      }
      else if (className.equals("int"))
      {
         return int.class;
      }
      else if (className.equals("char"))
      {
         return char.class;
      }     
      else if (className.equals("boolean"))
      {
         return boolean.class;
      }       
      else if (className.equals("double"))
      {
         return double.class;
      }          
      return Class.forName(className);
   }

}

